from django import forms
from captcha.fields import CaptchaField


class LoginForm(forms.Form):
    username = forms.CharField(required=True)
    password = forms.CharField(required=True)
    # captcha = CaptchaField()


class RegisterForm(forms.Form):
    email = forms.EmailField(required=True)
    password = forms.CharField(required=True, min_length=6)
    captcha = CaptchaField(required=True, error_messages={"invalid": u"验证码错误"})


class ForgetPwdForm(forms.Form):
    email = forms.EmailField(required=True)
    captcha = CaptchaField(required=True, error_messages={"invalid": u"验证码错误"})


class UpdatepwdForm(forms.Form):
    password = forms.CharField(required=True, min_length=6)
    password2 = forms.CharField(required=True, min_length=6)